package com.yuda.tools.miscellaneous.service.impl;

import com.yuda.common.core.web.domain.AjaxResult;
import com.yuda.tools.miscellaneous.dto.City;
import com.yuda.tools.miscellaneous.dto.School;
import com.yuda.tools.miscellaneous.mapper.SpartaThreeMapper;
import com.yuda.tools.miscellaneous.service.SpartaThreeTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SpartaThreeTableServiceImpl implements SpartaThreeTableService {

    @Autowired
    private SpartaThreeMapper spartaThreeMapper;

    @Override
    public void updateSchool(Long schoolId, int i) {
        spartaThreeMapper.updateSchool(i, schoolId);
    }

    @Override
    public void updateProvince(Long provinceId, int i) {
        spartaThreeMapper.updateProvince(i, provinceId);
    }

    @Override
    public void updateCity(Long cityId, int i) {
        spartaThreeMapper.updateCity(i, cityId);
    }

    @Override
    public List<City> listCity(Long provinceId) {

        return spartaThreeMapper.listCityByProvinceId(provinceId);
    }

    @Override
    public List<School> listSchool(Long cityId) {
        return spartaThreeMapper.listSchoolByCityId(cityId);
    }

    @Override
    public int count(String cityId) {
        return spartaThreeMapper.countStatusEq1(cityId);
    }


}
